home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
graphics
/
move4
/
move.bas
< prev
next >
Wrap
BASIC Source File
|
1995-10-22
|
8KB
|
216 lines
Attribute VB_Name = "MOVE1"
' '
' This example was made to show how easy it is to '
' move and size controls in VB 2 and 3 at runtime. '
' --> Since it's also (and still) easy enough to '
' manage this with VB4 this is the code: '
' '
' I've put it here again to be found by all users who '
' are using VB4 already and couldn't get the VB3 code '
' running without optical compromises. '
' '
' PLEASE, if you (All) have other ideas or results (!) '
' put them where most users find it (like this here)! '
' '
' This example was again made by: '
' Christian Germelmann '
' Am Glaskopf 26 '
' 35039 Marburg/Lahn '
' Germany '
' Phone +049 6421 45457 '
' CompuServe 100520,2644 '
' '
' ENJOY !!! '
' '
Option Explicit
Type POINTAPI
X As Integer
Y As Integer
End Type
Declare Function FlashWindow% Lib "USER" (ByVal hWnd%, ByVal bInvert%)
Declare Function SetWindowText% Lib "USER" (ByVal hWnd%, ByVal lpString$)
Declare Function GetWindowLong& Lib "USER" (ByVal hWnd%, ByVal nIndex%)
Declare Function SetWindowLong& Lib "USER" (ByVal hWnd%, ByVal nIndex%, ByVal dwNewLong&)
Declare Sub ReleaseCapture Lib "USER" ()
Declare Function SendMessage& Lib "USER" (ByVal hWnd%, ByVal wMsg%, ByVal wParam%, ByVal lParam&)
Global Const WM_SYSCOMMAND = &H112
Global Const MOUSE_MOVE = &HF012
Global Const GWL_STYLE = (-16)
Global Const GWL_EXSTYLE = (-20)
' ************************
' * Window Styles *
' * |use with GWL_STYLE| *
' ************************
Global Const WS_OVERLAPPED = &H0&
Global Const WS_POPUP = &H80000000
Global Const WS_CHILD = &H40000000
Global Const WS_MINIMIZE = &H20000000
Global Const WS_MINIMIZEBOX = &H20000
Global Const WS_VISIBLE = &H10000000
Global Const WS_DISABLED = &H8000000
Global Const WS_CLIPSIBLINGS = &H4000000
Global Const WS_CLIPCHILDREN = &H2000000
Global Const WS_MAXIMIZE = &H1000000
Global Const WS_MAXIMIZEBOX = &H10000
Global Const WS_CAPTION = &HC00000
Global Const WS_BORDER = &H800000
Global Const WS_DLGFRAME = &H400000
Global Const WS_VSCROLL = &H200000
Global Const WS_HSCROLL = &H100000
Global Const WS_SYSMENU = &H80000
Global Const WS_THICKFRAME = &H40000
Global Const WS_GROUP = &H20000
Global Const WS_TABSTOP = &H10000
Global Const WS_TILED = WS_OVERLAPPED
Global Const WS_ICONIC = WS_MINIMIZE
Global Const WS_SIZEBOX = WS_THICKFRAME
' ************************
' * Common Window Styles *
' * |use with GWL_STYLE| *
' ************************
Global Const WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
Global Const WS_POPUPWINDOW = (WS_POPUP Or WS_BORDER Or WS_SYSMENU)
Global Const WS_CHILDWINDOW = (WS_CHILD)
Global Const WS_TILEDWINDOW = (WS_OVERLAPPEDWINDOW)
' **************************
' * Extended Window Styles *
' * |use with GWL_EXSTYLE| *
' **************************
Global Const WS_EX_DLGMODALFRAME = &H1&
Global Const WS_EX_NOPARENTNOTIFY = &H4&
Global Const WS_EX_TOPMOST = &H8&
Global Const WS_EX_ACCEPTFILES = &H10&
Global Const WS_EX_TRANSPARENT = &H20&
' ************************
' * Dialog Styles *
' * |use with GWL_STYLE| *
' ************************
Global Const DS_ABSALIGN = &H1&
Global Const DS_SYSMODAL = &H2&
Global Const DS_LOCALEDIT = &H20&
Global Const DS_SETFONT = &H40&
Global Const DS_MODALFRAME = &H80&
Global Const DS_NOIDLEMSG = &H100&
' *************************
' * Button Control Styles *
' * |use with GWL_STYLE| *
' *************************
Global Const BS_PUSHBUTTON = &H0&
Global Const BS_DEFPUSHBUTTON = &H1&
Global Const BS_CHECKBOX = &H2&
Global Const BS_AUTOCHECKBOX = &H3&
Global Const BS_RADIOBUTTON = &H4&
Global Const BS_3STATE = &H5&
Global Const BS_AUTO3STATE = &H6&
Global Const BS_GROUPBOX = &H7&
Global Const BS_USERBUTTON = &H8&
Global Const BS_AUTORADIOBUTTON = &H9&
Global Const BS_PUSHBOX = &HA&
Global Const BS_OWNERDRAW = &HB&
Global Const BS_LEFTTEXT = &H20&
' ************************
' * Listbox Styles *
' * |use with GWL_STYLE| *
' ************************
Global Const LBS_NOTIFY = &H1&
Global Const LBS_SORT = &H2&
Global Const LBS_NOREDRAW = &H4&
Global Const LBS_MULTIPLESEL = &H8&
Global Const LBS_OWNERDRAWFIXED = &H10&
Global Const LBS_OWNERDRAWVARIABLE = &H20&
Global Const LBS_HASSTRINGS = &H40&
Global Const LBS_USETABSTOPS = &H80&
Global Const LBS_NOINTEGRALHEIGHT = &H100&
Global Const LBS_MULTICOLUMN = &H200&
Global Const LBS_WANTKEYBOARDINPUT = &H400&
Global Const LBS_EXTENDEDSEL = &H800&
Global Const LBS_DISABLENOSCROLL = &H1000&
Global Const LBS_STANDARD = (LBS_NOTIFY Or LBS_SORT Or WS_VSCROLL Or WS_BORDER)
' **************************
' * Combo Box Styles *
' * |use with GWL_STYLE| *
' **************************
Global Const CBS_SIMPLE = &H1&
Global Const CBS_DROPDOWN = &H2&
Global Const CBS_DROPDOWNLIST = &H3&
Global Const CBS_OWNERDRAWFIXED = &H10&
Global Const CBS_OWNERDRAWVARIABLE = &H20&
Global Const CBS_AUTOHSCROLL = &H40&
Global Const CBS_OEMCONVERT = &H80&
Global Const CBS_SORT = &H100&
Global Const CBS_HASSTRINGS = &H200&
Global Const CBS_NOINTEGRALHEIGHT = &H400&
Global Const CBS_DISABLENOSCROLL = &H800&
' **************************
' * Scroll Box Styles *
' * |use with GWL_STYLE| *
' **************************
Global Const SBS_HORZ = &H0&
Global Const SBS_VERT = &H1&
Global Const SBS_TOPALIGN = &H2&
Global Const SBS_LEFTALIGN = &H2&
Global Const SBS_BOTTOMALIGN = &H4&
Global Const SBS_RIGHTALIGN = &H4&
Global Const SBS_SIZEBOXTOPLEFTALIGN = &H2&
Global Const SBS_SIZEBOXBOTTOMRIGHTALIGN = &H4&
Global Const SBS_SIZEBOX = &H8&
' ************************
' * Edit Control Styles *
' * |use with GWL_STYLE| *
' ************************
Global Const ES_LEFT = &H0&
Global Const ES_CENTER = &H1&
Global Const ES_RIGHT = &H2&
Global Const ES_MULTILINE = &H4&
Global Const ES_UPPERCASE = &H8&
Global Const ES_LOWERCASE = &H10&
Global Const ES_PASSWORD = &H20&
Global Const ES_AUTOVSCROLL = &H40&
Global Const ES_AUTOHSCROLL = &H80&
Global Const ES_NOHIDESEL = &H100&
Global Const ES_OEMCONVERT = &H400&
Global Const ES_READONLY = &H800&
Global Const ES_WANTRETURN = &H1000&
' *************************
' * Static Control Styles *
' * |use with GWL_STYLE| *
' *************************
Global Const SS_LEFT = &H0&
Global Const SS_CENTER = &H1&
Global Const SS_RIGHT = &H2&
Global Const SS_ICON = &H3&
Global Const SS_BLACKRECT = &H4&
Global Const SS_GRAYRECT = &H5&
Global Const SS_WHITERECT = &H6&
Global Const SS_BLACKFRAME = &H7&
Global Const SS_GRAYFRAME = &H8&
Global Const SS_WHITEFRAME = &H9&
Global Const SS_USERITEM = &HA&
Global Const SS_SIMPLE = &HB&
Global Const SS_LEFTNOWORDWRAP = &HC&
Global Const SS_NOPREFIX = &H80&